Support longer relative paths in ResolveAssemblyReference HintPaths - #4414
Merged
rainersigwald merged 2 commits intoJun 17, 2019
Merged
Conversation
…ry longer than MAX_PATH dotnet#4348
Contributor
Author
|
Benchmark results: BenchmarkDotNet=v0.11.5, OS=Windows 10.0.18362
Intel Core i7-6700 CPU 3.40GHz (Skylake), 1 CPU, 4 logical and 4 physical cores
.NET Core SDK=2.1.800-preview-009677
[Host] : .NET Core 2.1.11 (CoreCLR 4.6.27617.04, CoreFX 4.6.27617.02), 64bit RyuJIT
DefaultJob : .NET Core 2.1.11 (CoreCLR 4.6.27617.04, CoreFX 4.6.27617.02), 64bit RyuJIT
As I understand it patch should reduce IO when you have different HintPath on the same file from different level project hierarchy. |
Uses the already-existing centralized codepath to normalize paths
rainersigwald
approved these changes
Jun 11, 2019
rainersigwald
left a comment
Member
There was a problem hiding this comment.
This looks great, thanks!
I pushed a change to use the standard-within-MSBuild method for this operation, which also allows removing the new using. I validated that the repro project from #4348 passes with my change.
Contributor
Author
|
@rainersigwald Thanks for the update. I didn't know about this API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This problem introduced in #3700. If hint path in reference plus current directory more than MAX_PATH then MSBuild couldn't resolve the reference. But file exists and the actual path less than MAX_PATH. The problem in function GetFileAttributesEx. This function just contacted hint path with the current directory, and it doesn't work when your current directory deep into file system but the library on the top of the hierarchy. I benchmarked this fix with BenchmarkDotNet and not found a statistically significant difference between the original code and my fix.